package com.yangchao.ch05

import groovy.xml.DOMBuilder

class example2 {
    public static void main(String[] args) {
        domBuilder()
    }

    /** dom构建器 **/
    static def domBuilder(){
        def domText='''
<root>
       <worker id="100" name="mike">
            <project id="99">flow</project>
       </worker>
       <worker id="101" name="john">
            <project id="99">flow</project>
       </worker> 
</root>   
'''
        def doc= DOMBuilder.parse(new StringReader(domText))
        println(doc.toString())

    }
}
